advertiserApp.controller("advertiserCtrl",function($scope,$http){
     //init data
      $http.post("/web-adv/getOutboxList").success(function(data){
	     console.log(data);
		 $scope.arr = data;
		 //$scope.todayNum = data
		 $("#pageBox").extendPagination({
		     totalCount:"100",
             showPage: '5',
             limit: '10',
             goPage:"",
             callback:function(page){
			     
			 }
		 });
	 }); 
	/* $scope.arr = data;
	 $scope.adId = data.msgPage.todayMsg[0].addressee_id; 	 
	 $scope.adminName = data.msgPage.todayMsg[0].sender_name;
	 $scope.adminId = data.msgPage.todayMsg[0].sender_id;*/
	 //console.log($scope.adminId);
	 //单行删除;
	 $scope.delOneMsg = function(id){
	     //console.log(id)
		 $http.post("/web-adv/deleteMsgInbox",{msgId:id}).success(function(data){
		     //console.log(data)
			 if(data.status=="1"){  //删除成功
			     //重新拉取数据   存储当前页码
			 }else{
			     alert("删除失败！");
			 }
		 });
	 }
});
var data = {
     todayNum:"2",
	 yesterdayNum:"2",
	 earlierNum:"1",
	 msgPage:{
	     todayMsg:[{		     
		     id:"10001",
			 sender_id:"admin01",
			 sender_name:"admin01",
			 sender_type:"管理员",
			 addressee_id:"ad001",
			 addressee_name:"广告主一",
			 addressee_type:"广告主",
			 mail_prefix:"今晚打老虎--今晚打老虎--今晚打老虎",
			 mail_title:"今晚打老虎--今晚打老虎--今晚打老虎",
			 flag:"0",
			 sender_time:"2014-1-12"
		 },
		 {		     
		     id:"10002",
			 sender_id:"admin02",
			 sender_name:"admin02",
			 sender_type:"管理员",
			 addressee_id:"ad001",
			 addressee_name:"广告主一",
			 addressee_type:"广告主",
			 mail_prefix:"今晚打老虎--今晚打老虎--今晚打老虎",
			 mail_title:"今晚打老虎--今晚打老虎--今晚打老虎",
			 flag:"0",
			 sender_time:"2014-3-12"
		 }],
		 yesterdayMsg:[{		     
		     id:"10001",
			 sender_id:"admin01",
			 sender_name:"admin01",
			 sender_type:"管理员",
			 addressee_id:"ad001",
			 addressee_name:"广告主一",
			 addressee_type:"广告主",
			 mail_prefix:"今晚打老虎--今晚打老虎--今晚打老虎",
			 mail_title:"今晚打老虎--今晚打老虎--今晚打老虎",
			 flag:"0",
			 sender_time:"2014-1-12"
		 },
		 {		     
		     id:"10002",
			 sender_id:"admin02",
			 sender_name:"admin02",
			 sender_type:"管理员",
			 addressee_id:"ad001",
			 addressee_name:"广告主一",
			 addressee_type:"广告主",
			 mail_prefix:"今晚到老虎--今晚到老虎--今晚到老虎",
			 mail_title:"今晚到老虎--今晚到老虎--今晚到老虎",
			 flag:"0",
			 sender_time:"2014-3-12"
		 }],
		 earlierMsg:[{		     
		     id:"10001",
			 sender_id:"admin01",
			 sender_name:"admin01",
			 sender_type:"管理员",
			 addressee_id:"ad001",
			 addressee_name:"广告主一",
			 addressee_type:"广告主",
			 mail_prefix:"今晚打老虎--今晚打老虎--今晚打老虎",
			 mail_title:"今晚打老虎--今晚打老虎--今晚打老虎",
			 flag:"0",
			 sender_time:"2014-1-12"
		 },
		 {		     
		     id:"10002",
			 sender_id:"admin02",
			 sender_name:"admin02",
			 sender_type:"管理员",
			 addressee_id:"ad001",
			 addressee_name:"广告主一",
			 addressee_type:"广告主",
			 mail_prefix:"今晚打老虎--今晚打老虎--今晚打老虎",
			 mail_title:"今晚打老虎--今晚到老虎--今晚打老虎",
			 flag:"0",
			 sender_time:"2014-3-12"
		 }],
	 }
}

